package vn.bk.hotel.dialog;

import vn.bk.hotel.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;

public class DialogExit {
    private AlertDialog.Builder dialog;

    public DialogExit(final Context mContext) {
	dialog = new AlertDialog.Builder(mContext);
	
	dialog.setTitle(mContext.getString(R.string.dialog_exit_title));
	dialog.setMessage(mContext.getString(R.string.message_exit));
	
	dialog.setPositiveButton(mContext.getString(R.string.dialog_ok),
		new OnClickListener() {

		    @Override
		    public void onClick(DialogInterface dialog, int which) {
			// TODO Auto-generated method stub
			((Activity) mContext).finish();
		    }
		});
	dialog.setNegativeButton(mContext.getString(R.string.dialog_cancel),
		new OnClickListener() {

		    @Override
		    public void onClick(DialogInterface dialog, int which) {
			// TODO Auto-generated method stub

		    }
		});
    }
    
    public void show(){
	dialog.show();
    }
}